<template>

    <el-table :data="users">
        <el-table-column prop="loginName" label="用户名" />
        <el-table-column prop="userName" label="姓名" />
        <el-table-column prop="userSex" label="性别">
            <template #default="scope">
                <el-tag v-if="scope.row.userSex == 1" type="success">男</el-tag>
                <el-tag v-else type="danger">女</el-tag>
            </template>
        </el-table-column>

        <el-table-column prop="userPhone" label="手机号" />
        <el-table-column prop="state" label="状态">
            <template #default="scope">
                <el-tag v-if="scope.row.state == 1" type="success">正常</el-tag>
                <el-tag v-else type="danger">禁用</el-tag>
            </template>
        </el-table-column>
        <el-table-column prop="addTime" label="创建时间">
            <template #default="scope">
                {{ scope.row.addTime.replace('T', " ").substring(0, 16) }}
            </template>
        </el-table-column>
        <el-table-column prop="usersId" label="操作">
            <template #default="scope">
                <el-button link type="primary"> 编辑</el-button>
            </template>
        </el-table-column>

    </el-table>

</template>

<script setup lang="ts">
import { ref, inject, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus';
import { useRouter, useRoute } from 'vue-router'
import { type AxiosStatic } from 'axios'


const axios = inject('axios') as AxiosStatic
const router = useRouter()
const route = useRoute()
onMounted(() => {
    GetUsers()
})
const users = ref([])

const GetUsers = () => {
    axios.get('/RbacMan/GetUsers'

    ).then(res => {
        users.value = res.data
    })
}

</script>